import type { NavigationMenuItem } from '@nuxt/ui'

interface NavLinkDefinition extends Omit<NavigationMenuItem, 'label'> {
  i18nKey: string
}

const navLinkDefinitions: NavLinkDefinition[] = [
  { i18nKey: 'nav.home', icon: 'i-lucide-home', to: '/' },
  { i18nKey: 'nav.projects', icon: 'i-lucide-folder', to: '/projects' },
  { i18nKey: 'nav.blog', icon: 'i-lucide-file-text', to: '/blog' },
  { i18nKey: 'nav.speaking', icon: 'i-lucide-mic', to: '/speaking' },
  { i18nKey: 'nav.about', icon: 'i-lucide-user', to: '/about' }
]

export const buildNavLinks = (t: (key: string) => string): NavigationMenuItem[] =>
  navLinkDefinitions.map(({ i18nKey, ...rest }) => ({
    ...rest,
    label: t(i18nKey)
  }))